package com.app.TCES.service;

import java.util.List;

import javax.annotation.Resource;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.app.TCES.domain.Department;

import com.app.TCES.mapper.A_DeptMapper;

@Service
public class A_DeptService {
	Logger log = LogManager.getLogger(A_DeptService.class);
	@Resource
	@Autowired
	A_DeptMapper a_DeptMapper;
	public List<Department> selectDept(int tmp,int limit) {
		log.debug("---> selecDept ");
		List<Department> dept = a_DeptMapper.selecDept(tmp,limit);
		log.debug("adminSevice  selecDept  --->");
		return dept;
	}
	/*public void delDept(int deptId) {
		log.debug("---> delDept----- ");
		 a_DeptMapper.deleteDept(deptId);
		log.debug("adminSevice  delDept  --->");
		
	}*/
	public int selectDepts() {
	int dept =	a_DeptMapper.selecDepts();
	return dept;
	}
	public void updateDept(String deptName,int deptId) {
		a_DeptMapper.updateDept(deptName, deptId);
	}
	
	
	public void insertDept(int deptId,String deptName) {
		a_DeptMapper.insertDept(deptId, deptName);
	}
}
